<%@ page language="java" import="java.util.*"
	import="com.gxuwz.medical.domain.user.*"
	import="com.gxuwz.medical.domain.role.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="../../css/pintuer.css">
<link rel="stylesheet" href="../../css/admin.css">
<script src="../../js/jquery-1.4.4.min.js"></script>
<script src="../../js/pintuer.js"></script>
</head>
<body>
	<%
		String userid = request.getParameter("userid");
		userid = new String(userid.getBytes("ISO-8859-1"),"UTF-8");
		User u = new User();
		u.setUserid(userid);
		u=u.query();
	%>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>修改用户</strong>
		</div>
		<div class="body-content">
			<form method="post" class="form-x" action="edit.user">
				<div class="form-group">
					<div class="label">
						<label>工号：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=u.getUserid()%>"
							name="userid" disabled="disabled" /> <input type="text"
							class="input w50" value="<%=u.getUserid()%>" name="userid"
							style="display: none" />
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>密码：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=u.getPwd()%>"
							name="pwd" data-validate="required:请输入密码" />
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>姓名：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=u.getFullName()%>"
							name="fullName" data-validate="required:请输入姓名" />
					</div>
				</div>

				<div class="form-group">

					<div class="label">
						<label>已分配：</label>
					</div>
					<br>	
						<%
							Iterator<Role> it = u.getRoles().iterator();
							while (it.hasNext()) {
						%>
						<%=it.next().getRoleid()%>|
					
					<%
						}
					%>
				</div>

				<div class="form-group">
					<div class="label">
						<label>分配角色：</label>
					</div>
					<br>
					<%
						Role r = new Role();
						List<Role> list = r.queryAll();
						if (!list.isEmpty()) {
							for (int i = 0; i < list.size(); i++) {
					%>


					<input type="checkbox" name="roleid"
						value="<%=list.get(i).getRoleid()%>" /><%=list.get(i).getRoleid() %><%=list.get(i).getRoleName()%>
					<%
						}
						}
					%>
				</div>

				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							提交</button>
					</div>
				</div>

			</form>
		</div>
	</div>

</body>
</html>